*** OPEN LOG/OUTPUT FILE ***

log using "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Output\cooperativeagreements.UQFE.SUPPLEMENTARY ANALYSIS #0.11-07-2020.smcl", replace



**** ACCESS DATABASE ***

use "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Data\cooperativeagreements.grantlevel.MANUSCRIPT MODELS.11-06-2020.dta", replace



**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************

*** CREATE THE EFFECTIVE SAMPLE FROM THE REGRESSION MODELS ESTIMATED IN THE MANUSCRIPT ***

quietly xtrifreg fed_funding   zpolicy2_abszero  zmanage2_abszero ceo  privmgt  pctagency_packing perc_prof nongov_recip  ///
zloyalty2_abszero  electionyear unified pres_party house_majority any_chair house_app house_ways lnnewpop pctpoverty pcincomecd   action_a action_b ///
ln_l1_recip_grantamt ln_l2_recip_grantamt ln_l3_recip_grantamt   ///
year_89 year_90 year_91 year_92 year_93 year_94  year_95 year_96 year_97 year_98 year_99 year_00 year_01 year_02 year_03 year_04 year_05 year_06 year_07 year_08, ///
fe i(subagency) q(05)


**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************


*** SUPPLEMENTARY ANALYSES INVOLVING BIVARIATE LINEAR PREDICTION FIT WITH 95% CONFIDENCE INTERVALS: AGGREGATE EFFECTIVE SAMPLE & ///
*** DISAGGREGATED BY LARGE, MEDIUM, AND SMALL CA AGENCY PORTFOLIOS *** 

*** FIRST, CREATE MEASURES FOR EACH AGENCY PORTFOLIO SIZE GROUPING ***

*** LARGE CA PORTFOLIO AGENCIES: 22,575 =< X =< 61,960 (SUBAGENCY==1;==13;==24): TOTAL: 130,359 (53.93% OF EFFECTIVE SAMPLE OF 241,730) 

tab lgagencyportfolio subagency if e(sample)
*
tab lgagencyportfolio  if e(sample) 
*
*
*
*** MODERATE CA PORTFOLIO AGENCIES: 11,692 =< X =< 17,080 (SUBAGENCY==2;==4;==8;==9;==2): TOTAL: 68,052 (28.15% OF EFFECTIVE SAMPLE OF 241,730)

gen medagencyportfolio = 1 if lgmedagencyportfolio==1 & lgagencyportfolio==0
replace medagencyportfolio = 0 if  medagencyportfolio==.
*
tab medagencyportfolio subagency if e(sample)
*
tab medagencyportfolio  if e(sample) 
*
*
*

*** SMALL CA PORTFOLIO AGENCIES: 11,692 =< X =< 17,080 (SUBAGENCY==3;==5;==7;==11;==12;==14;==15;==16;==17;==18;==21;==25;==26;==28;==45;==55;==56;==57;==59;==60;==63;==71): ///
*** TOTAL: 43,319 (17.92% OF EFFECTIVE SAMPLE OF 241,730)

gen smagencyportfolio = 1 if lgmedagencyportfolio==0
replace smagencyportfolio = 0 if  smagencyportfolio==.
*
tab smagencyportfolio subagency if e(sample)
*
tab smagencyportfolio  if e(sample) 
*
*
*

**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************


**** BIVARIATE LINEAR PREDICTION PLOTS BY AGENCY CA PORTFOLIO SIZE GROUPINGS BY DIFFERENT CA PARTNER ORGANIZATIONS [LOGGED CA AWARD SIZE DUE TO SKEW OF CA AWARD VALUES & COMPARABILITY ACROSS GRAPHS] ***


*** TOTAL EFFECTIVE SAMPLE [N = 241,730]

twoway  (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & lgagencyportfolio==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & medagencyportfolio==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & smagencyportfolio==1), ytitle((ln)Constant Federal Funds) ytitle(, margin(small)) xtitle(Agency Head Policy Expertise) title(FIGURE SI-0.1: Agency Portfolio Size by Policy Expertise, size(medsmall)) legend(off) scheme(sj)

**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************


*** GOVERNMENTAL PARTNER ORGANIZATIONS [N = 151,851: 62.82% of TOTAL EFFECTIVE SAMPLE]; [LARGE CA AGENCIES: N = 75,777: 31.35% of OF TOTAL EFFECTIVE SAMPLE] ///
*** [MODERATE CA AGENCIES: N = 46,816: 19.37% of OF TOTAL EFFECTIVE SAMPLE]; [SMALL CA AGENCIES: N = 29,258: 12.10% of OF TOTAL EFFECTIVE SAMPLE]

twoway  (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & lgagencyportfolio==1 & gov_recip==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & medagencyportfolio==1 & gov_recip==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & smagencyportfolio==1 & gov_recip==1), ytitle((ln)Constant Federal Funds) ytitle(, margin(small)) xtitle(Agency Head Policy Expertise) title(FIGURE SI-0.2: Agency Portfolio Size by Policy Expertise, size(medsmall)) subtitle(Government Partner , size(medsmall)) legend(off) scheme(sj)
 


*** NON-GOVERNMENTAL PARTNER ORGANIZATIONS [N = 89,879: 37.18% of TOTAL EFFECTIVE SAMPLE]; [LARGE CA AGENCIES: N = 54,582: 22.58% of OF TOTAL EFFECTIVE SAMPLE] ///
*** [MODERATE CA AGENCIES: N = 21,236: 8.79% of OF TOTAL EFFECTIVE SAMPLE]; [SMALL CA AGENCIES: N = 14,061: 5.82% of OF TOTAL EFFECTIVE SAMPLE]

twoway  (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & lgagencyportfolio==1 & gov_recip==0) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & medagencyportfolio==1 & gov_recip==0) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & smagencyportfolio==1 & gov_recip==0), ytitle((ln)Constant Federal Funds) ytitle(, margin(small)) xtitle(Agency Head Policy Expertise) title(FIGURE SI-0.3: Agency Portfolio Size by Policy Expertise, size(medsmall)) subtitle(Non-Government Partner , size(medsmall)) legend(off) scheme(sj)


**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************


*** NONPROFIT NON-GOVERNMENTAL PARTNER ORGANIZATIONS [N = 44,333: 18.34% of TOTAL EFFECTIVE SAMPLE]; [LARGE CA AGENCIES: N = 29,100: 12.04% of OF TOTAL EFFECTIVE SAMPLE] ///
*** [MODERATE CA AGENCIES: N = 8,983: 3.72% of OF TOTAL EFFECTIVE SAMPLE]; [SMALL CA AGENCIES: N = 6,250: 2.59% of OF TOTAL EFFECTIVE SAMPLE]

twoway  (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & lgagencyportfolio==1 & nonprofit_recip==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & medagencyportfolio==1 & nonprofit_recip==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & smagencyportfolio==1 & nonprofit_recip==1), ytitle((ln)Constant Federal Funds) ytitle(, margin(small)) xtitle(Agency Head Policy Expertise) title(FIGURE SI-0.4: Agency Portfolio Size by Policy Expertise, size(medsmall)) subtitle(Nonprofit Partner , size(medsmall)) legend(off) scheme(sj)



*** PRIVATE SECTOR NON-GOVERNMENTAL PARTNER ORGANIZATIONS [N = 45,546: 18.84% of TOTAL EFFECTIVE SAMPLE]; [LARGE CA AGENCIES: N = 25,482: 10.54% of OF TOTAL EFFECTIVE SAMPLE] ///
*** [MODERATE CA AGENCIES: N = 12,253: 5.07% of OF TOTAL EFFECTIVE SAMPLE]; [SMALL CA AGENCIES: N = 7,811: 3.23% of OF TOTAL EFFECTIVE SAMPLE]

twoway  (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & lgagencyportfolio==1 & private_recip==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & medagencyportfolio==1 & private_recip==1) (lfitci ln_fed_funding zpolicy2_abszero if e(sample) & smagencyportfolio==1 & private_recip==1), ytitle((ln)Constant Federal Funds) ytitle(, margin(small)) xtitle(Agency Head Policy Expertise) title(FIGURE SI-0.5: Agency Portfolio Size by Policy Expertise, size(medsmall)) subtitle(Private Sector Partner , size(medsmall)) legend(off) scheme(sj)


*** notes on graphics code format for graphs made above. (1) Label Legends "Large CA Portfolio Agencies"; "Medium CA Portfolio Agencies"; & "Small CA Portfolio Agencies" ///
*** (2) Label Y-Axis "Natural Logarithm of CA Award"; (3) Label X-Axis "Agency Head Policy Expertise"; (4) Title Heading "Figure SI-0A".... "Figure SI-OE [five graphs]; ///
*** (5) Subtitle Heading "Full Sample", "Government Organizations", "Non-Government Organizations", "Nonprofit Organizations", and "Private Organizations"; ///
*** (6) Save each graphics file   





**** ACCESS DATABASE ***

save "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Data\cooperativeagreements.grantlevel.SUPPLEMENTARY ANALYSIS #0.11-07-2020.dta", replace


log close
